package com.viking.XFT;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.FrameLayout;

public class FloatMenu extends FrameLayout {

    public FloatMenu(Context context) {
        super(context);
        init(context);
    }

    private void init(Context context) {
        LayoutInflater.from(context).inflate(R.layout.float_menu, this);
        findViewById(R.id.layout_float_menu).setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View view) {
                FloatManager.getInstance(null).shiftFloat(FloatManager.FLOAT_VIEW_TYPE.FLOAT_BUTTON);
            }
        });

        findViewById(R.id.imageButtonHome).setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View view) {
                FloatManager.getInstance(null).goHome();
            }
        });

        findViewById(R.id.imageButtonLock).setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View view) {
                FloatManager.getInstance(null).lockScreen();
            }
        });
        /*findViewById(R.id.imageButtonLock).setOnLongClickListener(new OnLongClickListener() {
            @Override
            public boolean onLongClick(View view) {
                FloatManager.getInstance(null).openPowerMenu();
                return true;
            }
        });*/

        findViewById(R.id.imageButtonSettings).setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View view) {
                FloatManager.getInstance(null).openSetting();
            }
        });

        findViewById(R.id.imageButtonPrevious).setOnClickListener(new OnClickListener() {
            @Override
            public void onClick(View view) {
                //FloatManager.getInstance(null).openRecentApp();
                FloatManager.getInstance(null).openPreviousApp();
            }
        });
    }
}
